package com.yjt.fresh.adpater;

import android.graphics.Color;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yjt.fresh.R;
import com.yjt.fresh.bean.BeanGoodsCategories;
import com.yjt.fresh.bean.BeanHomePage;

import java.util.List;

/**
 * 商品一级分类
 * Created by mcc on 2018/6/16.
 */

public class AdpRvProductsCategoryMenu extends BaseQuickAdapter<BeanGoodsCategories, BaseViewHolder> {
    public AdpRvProductsCategoryMenu(int layoutResId, @Nullable List<BeanGoodsCategories> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BeanGoodsCategories item) {
        int position = helper.getAdapterPosition();
        TextView tv = helper.getView(R.id.tv_app_recyle_item_category_menu);
        tv.setText(item.getTITLE());
        if (position == 0) {
            tv.setBackgroundColor(Color.parseColor("#43b624"));
            tv.setTextColor(Color.WHITE);
        }
    }
}
